package com.wuxiaofan.member.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wuxiaofan.member.entity.MemberLoginLog;
import com.wuxiaofan.member.entity.custom.MemberLoginLogCustom;
import com.wuxiaofan.member.mapper.MemberLoginLogMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.wuxiaofan.member.client.Idgenerator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;

@Service
public class MemberLoginLogService {
    @Autowired
    private MemberLoginLogMapper umsMemberLoginLogMapper;
    @Resource
    private Idgenerator idgenerator;
    public MemberLoginLog findById(String id){
        return umsMemberLoginLogMapper.selectById(id);
    }

    public MemberLoginLogCustom findCountByMap(Map paraMap){
        return umsMemberLoginLogMapper.findCountByMap(paraMap);
    }

    public MemberLoginLogCustom findGroupByMap(Map paraMap){
        return umsMemberLoginLogMapper.findGroupByMap(paraMap);
    }

    public List<MemberLoginLogCustom> findByMap(Map paraMap){
        return umsMemberLoginLogMapper.findByMap(paraMap);
    }

    public Page<MemberLoginLogCustom> findByMap(Map paraMap, Page page){
        return page.setRecords(umsMemberLoginLogMapper.findByMap(paraMap,page));
    }


    public void updateMapById(Map paraMap){
        umsMemberLoginLogMapper.updateMapById(paraMap);
    }
    public void delById(String id){
        umsMemberLoginLogMapper.deleteById(id);
    }

    public MemberLoginLog save(MemberLoginLog umsMemberLoginLog){
        umsMemberLoginLog.setId(idgenerator.getId());
        umsMemberLoginLogMapper.insert(umsMemberLoginLog);
        return umsMemberLoginLog;
    }

}
